using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using TimeSheetBLL;

namespace TimeSheet.includes
{
    /// <summary>
    ///		Summary description for ProHeader.
    /// </summary>
    public abstract class ProHeader : UserControl
    {
        protected LinkButton LinkButton1;
        protected HyperLink HyperLink1;
        protected Label lblMessage;
        protected HyperLink hlPrintReports;
        protected Image imgHeading;
        protected Image imgLogo;

        private void Page_Load(object sender, EventArgs e)
        {
            User user = Session["User"] as User;
            if (user == null)
            {
            }
            else
            {
                if (user.FullName == "Mike Buckley")
                {
                    lblMessage.Text = "<div align=\"right\">Who's Gay?: " + user.FirstName +
                                      " " + user.LastName;
                    imgHeading.ImageUrl = "../images/buckles.jpg";
                    imgLogo.ImageUrl = "../images/fathat403.jpg";
                }
                else
                {
                    lblMessage.Text = "<div align=\"right\">Logged in: " + user.FirstName +
                                      " " + user.LastName;
                }
            }
        }

        #region Web Form Designer generated code

        protected override void OnInit(EventArgs e)
        {
            //
            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            //
            InitializeComponent();
            base.OnInit(e);
        }

        ///		Required method for Designer support - do not modify
        ///		the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.LinkButton1.Click += new System.EventHandler(this.LinkButton1_Click);
            this.Load += new System.EventHandler(this.Page_Load);
        }

        #endregion

        private void LinkButton1_Click(object sender, EventArgs e)
        {
            Session["User"] = null;
            Session["Administrator"] = null;
            Response.Redirect("default.aspx");
        }
    }
}